import service from "../utils/request";

// 获取seller
export function getSeller(query: any) {
  return service.request({
      url: '/getTenant',
      method: 'get',
      params: query,
  })
}

// 登录方法
export function getLogin(query: any) {
  return service.request({
    url: '/login',
    headers: {
      isToken: false,
      repeatSubmit: false
    },
    method: 'get',
    params: query
  })
}

// 注册方法
export function register(data: any) {
  return service.request({
    url: '/auth/register',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}

// 刷新方法
export function refreshToken() {
  return service.request({
    url: '/auth/refresh',
    method: 'post'
  })
}

// 获取用户详细信息
export function getInfo() {
  return service.request({
    url: '/mine/appUser/currentLoginUser',
    method: 'get'
  })
}

// 退出方法
export function logout(token: string | undefined) {
  return service.request({
    url: '/mine/appUser/logout',
    method: 'post'
  })
}

// 获取验证码
export function getCodeImg() {
  return service.request({
    url: '/captchaImage',
    headers: {
      isToken: false
    },
    method: 'get',
    timeout: 20000
  })
}